<?xml version="1.0" encoding="iso-8859-1"?>

<!-- 
  -- Please see the readme.txt file included with this distribution for 
  -- attribution and copyright information.
  -->

<root version="2.0">
	<windowclass name="charsheetmini_inventoryitem">
		<sizelimits>
			<minimum>
				<height>10</height>
			</minimum>
		</sizelimits>
		<script>
			function updateStatus()
				windowlist.applyFilter();
			end
		</script>
		<sheetdata>
			<!-- Hidden fields -->
			<numberfield name="showonminisheet">
				<invisible />
				<bounds>0,0,1,1</bounds>
				<script>
					function onValueChanged()
						window.updateStatus();
					end
				</script>
			</numberfield>

			<jpgnumberfield name="count">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>2</offset>
					</left>
					<top>
						<anchor>top</anchor>
						<offset>4</offset>
					</top>
					<size>
						<width>20</width>
						<height>15</height>
					</size>
				</anchored>
				<frame>
					<name>bonus</name>
					<offset>5,5,5,5</offset>
				</frame>
				<font>sheetnumbersmall</font>
				<hideonvalue>0</hideonvalue>
				<noreset />
				<delaykeyupdate />
				<script>
					function onDoubleClick(x,y)
						window.dice.onDoubleClick(x,y);
					end
				</script>
			</jpgnumberfield>
			<textlistitemvalue name="name">
				<anchored>
					<left>
						<anchor>left</anchor>
						<offset>28</offset>
					</left>
					<right>
						<anchor>right</anchor>
						<offset>-25</offset>
					</right>
					<top>
						<anchor>top</anchor>
						<offset>3</offset>
					</top>
				</anchored>
			</textlistitemvalue>
			<windowreferencefield name="shortcut">
				<anchored>
					<right>
						<anchor>right</anchor>
					</right>
					<top>
						<anchor>top</anchor>
					</top>
					<size>
						<width>20</width>
						<height>20</height>
					</size>
				</anchored>
				<icon>
					<normal>button_openwindow</normal>
					<empty>button_emptytarget</empty>
					<pressed>button_emptytarget</pressed>
				</icon>
				<allowdrop />
			</windowreferencefield>
			
		</sheetdata>
	</windowclass>

	<windowclass name="charsheetmini_inventory">
		<placement>
			<size>
				<width>360</width>
				<height>220</height>
			</size>
		</placement>
		<nodelete />
		<sheetdata>

			<!-- COINS -->
			<genericcontrol name="mini_coinframe">
				<bounds>0,10,-1,65</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<sheetnumber name="coinamount1" source="coins.slot1.amount">
				<anchored>
					<to>mini_coinframe</to>
					<position>insidetopleft</position>
					<offset>50,30</offset>
					<size>
						<width>75</width>
						<height>25</height>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount1</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFFFFFFF</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount2" source="coins.slot2.amount">
				<anchored>
					<to>coinamount1</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>75</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount2</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFFFDF4B</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount3" source="coins.slot3.amount">
				<anchored>
					<to>coinamount2</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>75</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount3</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFE3E3E3</iconcolor>
			</genericcontrol>

			<sheetnumber name="coinamount4" source="coins.slot4.amount">
				<anchored>
					<to>coinamount3</to>
					<position>right</position>
					<offset>6,0</offset>
					<size>
						<width>75</width>
					</size>
				</anchored>
				<frame>
					<name>modifier</name>
					<offset>5,3,5,3</offset>
				</frame>
				<keyeditframe>
					<name>sheetfocus</name>
					<offset>5,3,5,3</offset>
				</keyeditframe>
				<font>sheetnumbersmall</font>
				<noreset />
				<stateframe>
					<drophilight>
						<name>sheetfocusplus</name>
						<offset>5,5,5,5</offset>
					</drophilight>
				</stateframe>
				<droptypes>
					<type>number</type>
				</droptypes>
				<script>
					function onDrop(x, y, draginfo)
						if draginfo.isType("number") then
							setValue(getValue() + draginfo.getNumberData());
							return true;
						end
					end
				</script>
			</sheetnumber>
			<genericcontrol>
				<anchored>
					<to>coinamount4</to>
					<position>above</position>
					<offset>0,-16</offset>
				</anchored>
				<icon>indicator_coin</icon>
				<iconcolor>#FFDDA15B</iconcolor>
			</genericcontrol>

			<!-- ITEMS -->
			<genericcontrol name="mini_inventoryframe">
				<bounds>0,75,-1,-15</bounds>
				<frame>
					<name>sheetgroup</name>
				</frame>
			</genericcontrol>

			<windowlist name="inventorylist">
				<anchored>
					<to>mini_inventoryframe</to>
					<position>over</position>
					<offset>-12,-15</offset>
				</anchored>
				<datasource>.inventorylist</datasource>
				<class>charsheetmini_inventoryitem</class>
				<script>
					function onFilter(w)
						local node = w.getDatabaseNode().getChild("showonminisheet");
						if node and node.getValue() ~= 0 then
							return true;
						end
						return false;
					end
				
					function onSortCompare(w1, w2)
						if w1.name.getValue() == "" then
							return true;
						elseif w2.name.getValue() == "" then
							return false;
						end
					
						return w1.name.getValue() &gt; w2.name.getValue();
					end
				</script>
			</windowlist>
			<scrollercontrol>
				<anchored>
					<to>inventorylist</to>
					<position>insidebottomright</position>
					<size>
						<width>45</width>
						<height>27</height>
					</size>
				</anchored>
				<target>inventorylist</target>
				<button>
					<normal>button_scroller</normal>
					<pressed>button_scroller_down</pressed>
				</button>
			</scrollercontrol>

		</sheetdata>
	</windowclass>
</root>
